package com.asura.qqeffect;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.ScrollView;

import java.util.ArrayList;

public class Main3Activity extends AppCompatActivity {

    private ScrollView scrollView;
    private ListView listView;
    private boolean isEnd;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main3);
        scrollView = (ScrollView) findViewById(R.id.scrollView);
        listView = (ListView) findViewById(R.id.list);
        ArrayList<String> strings = new ArrayList<>();
        for (int i = 0; i < 20; i++) {
            strings.add("haha哈哈" + i);
        }
        listView.setAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, android.R.id.text1, strings));
        getWindow().getDecorView().postDelayed(new Runnable() {
            @Override
            public void run() {

                int[] points = new int[2];
                ((ViewGroup) getWindow().getDecorView()).getChildAt(0).getLocationInWindow(points);
                int i = getResources().getDisplayMetrics().heightPixels - points[1];
                Log.i("TAG", points[1]+ " statusbar " + i);
            }
        },2000);
    }
}
